package com.wish;

import java.util.Objects;

/**
 * Author: Eric
 * 9/8/2022 1:58 PM
 */
public class Demo05DoubleCheck {

    private static volatile Demo05DoubleCheck instance;
    private Demo05DoubleCheck(){}
    public static synchronized Demo05DoubleCheck getInstance(){
        if(Objects.isNull(instance)){
            synchronized (Demo05DoubleCheck.class){
                if(Objects.isNull(instance)){
                    instance = new Demo05DoubleCheck();
                }
            }
        }
        return instance;
    }

}
